#------------------------------------------------------------------------------
# Project:     Multi-Programmer Game Demo
# Name:        Ball.py
# Purpose:     Bouncing Ball Object
# 
# Authors:     Chris Spooner, Chris La-Roo
# Main Author: Chris Spooner
#
# Created:     11/30/2012
# Copyright:   (c) Chris Spooner 2012
# Licence:     New BSD
#------------------------------------------------------------------------------
import pygame, math, sys, random

class Ball():
    def __init__(self, speed, position):
        self.surfaces = []
        self.surfaces += [pygame.image.load("rsc/ball/ball1-1.png")]
        self.surfaces += [pygame.image.load("rsc/ball/ball1-2.png")]
        self.frame = 0
        self.maxFrame = len(self.surfaces)-1
        self.surface = self.surfaces[self.frame]
        self.rect = self.surface.get_rect()
        self.speed = speed
        self.place(position)
        self.living = True
        if pygame.mixer:
            self.bounceSound = pygame.mixer.Sound("bounce.wav")
        
    def  __str__(self):
        return "I'm a ball " + str(self.rect.center) + str(self.speed) + str(self.living)
     
    def place(self, position):
        print "I've moved to", position
        
    def move(self):
        print "I've moved", self.speed
        
    def collideFloor(self, screenHeight):
        print "trying to hit bottom of screen", screenHeight
    
    def collideWall(self, screenWidth, screenHeight):
        print "trying to hit edges of screen", screenWidth, screenHeight
        
    def collidePaddle(self, paddle):
        print "trying to hit paddle", str(paddle)
        #if pygame.mixer:
        #   self.bounceSound.play()
        
    def collideBall(self, other):
        print "trying to hit ", str(other)